/*
 * Android Runner is a multiplayer GPS game fully written by Xurxo Mendez Perez
 * 
 * Copyright (C) 2009 Xurxo Mendez Perez
 *   
 * This file is part of Android Runner.
 * 
 * Android Runner is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Android Runner is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Android Runner.  If not, see <http://www.gnu.org/licenses/>.
 */

package es.sonxurxo.androidrunner.model.service.player.to;

import java.io.Serializable;

import es.sonxurxo.androidrunner.model.persistence.player.entity.Player;

/**
 * 
 * @author "Xurxo Mendez Perez"
 *
 */

public class LoginResultTO implements Serializable {

	private static final long serialVersionUID = -8864231365061706556L;
	
	private String login;
	private String email;
	private String phone;
	private String name;
	private String surname;
	private String country;
	private String role;
	private boolean showPersonalInfo;
	private int totalPoints;
	private int maxPoints;
	private int bestRank;
	private int imageId;
	private long gameId;
	
	public LoginResultTO(String login, String email, String phone,
			String name, String surname, String country,
			boolean showPersonalInfo, int totalPoints, int maxPoints,
			int bestRank, int imageId, long gameId, String role) {
		super();
		this.login = login;
		this.showPersonalInfo = showPersonalInfo;
		this.email = email;
		this.phone = phone;
		this.name = name;
		this.surname = surname;
		this.country = country;
		this.totalPoints = totalPoints;
		this.maxPoints = maxPoints;
		this.bestRank = bestRank;
		this.imageId = imageId;
		this.gameId = gameId;
		this.role = role;
	}

	public LoginResultTO(Player player) {
		super();
		this.login = player.getUserData().getLogin();
		this.showPersonalInfo= player.getUserData().isShowPersonalInfo();
		this.email = player.getUserData().getEmail();
		this.phone = player.getUserData().getPhone();
		this.name = player.getUserData().getName();
		this.surname = player.getUserData().getSurname();
		this.country = player.getUserData().getCountry();
		this.totalPoints = player.getTotalPoints();
		this.maxPoints = player.getMaxPoints();
		this.bestRank = player.getBestRank();
		this.imageId = player.getImageId();
		if (player.getGame() != null)
			this.gameId = player.getGame().getGameId();
		else
			this.gameId = -1;
		this.role = player.getUserData().getRole();
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public boolean isShowPersonalInfo() {
		return showPersonalInfo;
	}

	public void setShowPersonalInfo(boolean showPersonalInfo) {
		this.showPersonalInfo = showPersonalInfo;
	}

	public int getTotalPoints() {
		return totalPoints;
	}

	public void setTotalPoints(int totalPoints) {
		this.totalPoints = totalPoints;
	}

	public int getMaxPoints() {
		return maxPoints;
	}

	public void setMaxPoints(int maxPoints) {
		this.maxPoints = maxPoints;
	}

	public int getBestRank() {
		return bestRank;
	}

	public void setBestRank(int bestRank) {
		this.bestRank = bestRank;
	}

	public int getImageId() {
		return imageId;
	}

	public void setImageId(int imageId) {
		this.imageId = imageId;
	}

	public long getGameId() {
		return gameId;
	}

	public void setGameId(long gameId) {
		this.gameId = gameId;
	}

	public String getRole() {
		return this.role;
	}

	public void setRole(String role) {
		this.role = role;
	}
}